﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="Microsoft.Web.Mvc"%>
<asp:Content ID="loginHead" ContentPlaceHolderID="head" runat="server">
    <title>Thay đổi mật khẩu</title>
</asp:Content>
<asp:Content ID="js_css" ContentPlaceHolderID="js_css" runat="server">
<style>
label.contact 
{
	width:130px;
}
input.contact_input
{
	width:190px;
}
</style>
</asp:Content>
<asp:Content ID="loginContent" ContentPlaceHolderID="left_content" runat="server">

    <div class="crumb_nav">
             <a href="/home/index">Trang Chủ</a> &gt;&gt; Thay đổi mật khẩu
     </div>
     <div class="title"><span class="title_icon"><img title="" alt="" src="/content/images/bullet1.gif"></span>My account</div>
        
        	<div class="feat_prod_box_details">

              	<div class="contact_form" style="width:auto;">
                <div class="form_subtitle">Thay đổi mật khẩu</div>
                 <div style="text-align:center;">
                  <% if (ViewData["success"] != null)
                   { %>
                <div class="success"><%= Html.Encode(ViewData["success"])%></div>
                <%} %>
                <% if (ViewData["error"] != null)
                   { %>
                <div class="warning"><%= Html.Encode(ViewData["error"])%></div>
                <%} %>
                </div>
                  <form action="/account/changepassword" method="post" id="changepassword1" name="changepassword1" >          
                    <div class="form_row">
                    <label class="contact"><strong>Mật khẩu cũ:</strong></label>
                    <input type="password" class="contact_input" name="old_password" id="old_password" maxlength="20" />
                    </div>  


                    <div class="form_row">
                    <label class="contact"><strong>Mật khẩu Mới:</strong></label>
                    <input type="password" class="contact_input" name="new_password" id="new_password" maxlength="20" />
                    </div>      
                    
                    <div class="form_row">
                    <label class="contact"><strong>Nhập lại Mật khẩu Mới:</strong></label>
                    <input type="password" class="contact_input" name="confirm_new_password" id="confirm_new_password" maxlength="20" />
                    </div>                   
                    
                    <div class="form_row">
                    <input type="submit" value="Thay Đổi" onclick="return check_validate()" class="register"  id="thaydoi"/>
                    </div>   
                    
                  </form>     
                    
                </div>  
            
            </div>	
            
                 
<div class="clear"></div> 
 <script type="text/javascript">            
 function check_validate() {
     if (document.getElementById("old_password").value == "") {
             alert('Vui lòng nhập tên mật khẩu cũ');
             document.getElementById("old_password").focus();
             return false;
         }
         else if (document.getElementById("new_password").value == "") {
             alert('Vui lòng nhập mật khẩu mới');
             document.getElementById("new_password").focus();
             return false;
         }
         else if (document.getElementById("new_password").value.length < 6) {
             alert('mật khẩu phải dài hơn 6 kí tự');
             document.getElementById("new_password").focus();
             return false;
         }
         else if (document.getElementById("confirm_new_password").value == "" || document.getElementById("new_password").value != document.getElementById("confirm_new_password").value) {
             alert('Mật khẩu mới nhập lại không giống');
             document.getElementById("confirm_new_password").focus();
             return false;
         }
         else {
           $('#changepassword1').submit();      
         }
         
     }
 </script>

</asp:Content>
<asp:Content ID="indexContentRight" ContentPlaceHolderID="right_content" runat="server">
   <% Html.RenderAction("index","sidebar"); %>
</asp:Content>
